package com.hyfd.controller.mp;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hyfd.controller.sys.BaseController;
import com.hyfd.service.mp.DataDiscountModelDetailSer;


@Controller
//@Scope("prototype") //开启非单例模式 用于并发控制
public class DataDiscountModelDetailCtl extends BaseController{
	
	@Autowired
	private DataDiscountModelDetailSer dataDiscountModelDetailSer;
	
	/**
	 * 查询折扣详情 使用get方式提交
	 * @param req
	 * @return
	 */
	@GetMapping("dataDiscountModelDetailList/{id}")
	@ResponseBody
	public String dataDiscountModelDetailList(@PathVariable("id")String id, HttpServletRequest req){
		return dataDiscountModelDetailSer.dataDiscountModelDetailList(req,id);
	}
	/**
	 * 跳转到折扣添加页面
	 * 
	@GetMapping("dataDiscountModelDetailAddPage/{id}")
	public String dataDiscountModelDetailAddPage(@PathVariable("id")String id,HttpServletRequest req) {
		return dataDiscountModelDetailSer.dataDiscountModelDetailAddPage(id, req);
	}
	*/
	
	/**
	 * 添加折扣
	 * */
	@PostMapping("dataDiscountModelDetail")
	public String dataDiscountModelDetailAdd(HttpServletRequest req){
		return dataDiscountModelDetailSer.dataDiscountModelDetailAdd(req);
	}
	/**
	 * 跳转到折扣设置页面
	 * */
	@GetMapping("dataDiscountModelDetailEditPage/{id}")
	public String dataDiscountModelDetailEditPage(@PathVariable("id")String id,HttpServletRequest req){
		return dataDiscountModelDetailSer.dataDiscountModelDetailEditPage(id, req);
	}
	/**
	 * 设置页面详情信息
	 * */
	@GetMapping("dataDiscountModelDetailEditPageDetail")
	@ResponseBody
	public String dataDiscountModelDetailEditPageDetail(HttpServletRequest req){
		return dataDiscountModelDetailSer.dataDiscountModelDetailEditPageDetail(req);
	}
	
	/**
	 * 折扣模板上传
	 * */
	@PostMapping("DataDiscountModelEx1")
	@ResponseBody
	public String DataDiscountModelEx1(HttpServletRequest req) {
		return dataDiscountModelDetailSer.DataDiscountUpload(req);
	}
}
